package com.wangsan.study.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.wangsan.study.domain.ResourceEntity;
import com.wangsan.study.domain.ResourceEntityRepository;

/**
 * ResourceEntityService
 *
 * @author wangsan
 * @date 2016/12/13
 */
@Transactional
@Service
public class ResourceEntityService {

    @Autowired
    private ResourceEntityRepository resourceEntityRepository;

    public Iterable<ResourceEntity> findAll() {
        return resourceEntityRepository.findAll();
    }

    public void save(Iterable<ResourceEntity> entityIterator) {
        resourceEntityRepository.save(entityIterator);
    }

    public ResourceEntity findByPath(String path) {
        return resourceEntityRepository.findByPath(path);
    }

    public ResourceEntity save(ResourceEntity entity) {
        return resourceEntityRepository.save(entity);
    }

}
